package serverDB;

import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;
/**
 * container of one row data in Box table
 * @author ran
 *
 */
public class Box implements Serializable{
	/**
	 * default serialVersionUID
	 */
	private static final long serialVersionUID = 1L;
	private long boxId = 0 ;
	private long computerId = 0;
	private String boxProperty = "";
	private String boxName="";
	private Set<Client> clients = new HashSet<Client>();
	private Set<File> files = new HashSet<File>();
	//getters and setters
	public String getBoxName() {
		return boxName;
	}
	public void setBoxName(String boxName) {
		this.boxName = boxName;
	}
	
	public void removeFile(File file){
		files.remove(file);
	}
	public Set<File> getFiles() {
		return files;
	}
	public void setFiles(Set<File> files) {
		this.files = files;
	}
	
	public void addFiles(File file) {
		this.files.add(file);
	}
	public Set<Client> getclients() {
		return clients;
	}
	public void setClients(Set<Client> clients) {
		this.clients = clients;
	}
	public void addClients(Client client) {
		this.clients.add(client);
	}
	public long getBoxId() {
		return boxId;
	}
	public void setBoxId(long boxId) {
		this.boxId = boxId;
	}
	public long getComputerId() {
		return computerId;
	}
	public void setComputerId(long computerId) {
		this.computerId = computerId;
	}
	public String getBoxProperty() {
		return boxProperty;
	}
	public void setBoxProperty(String boxProperty) {
		this.boxProperty = boxProperty;
	}
	@Override
	public boolean equals(Object obj) {
		Box box = (Box)obj;
		if(boxId==box.getBoxId())
			return true;
		return false;
	}
}
